const inputDom = document.getElementById("inputDom");
function throttle(func, wait) {
  // 上次执行函数时间
  let lastTime = 0;
  return function () {
    // 当前时间
    let now = +new Date();
    if (now - lastTime > wait) {
      lastTime = now;
      func.apply(this, arguments);
    }
  };
}
inputDom.addEventListener(
  "input",
  throttle(function (e) {
    console.log(this);
    console.log(e);
  }, 1000)
);
